package homework03;

/**
 * 通话套餐类 特征：通话时长、短信条数、每月资费 行为: 显示所有套餐信息
 */
public class Call extends SetMeal implements CallInterface {
    private int talk_time;       //通话时长
    private int message_num;     //短信条数

    public Call() {
    }

    public int getTalk_time() {
        return talk_time;
    }

    public void setTalk_time(int talk_time) {
        this.talk_time = talk_time;
    }

    public int getMessage_num() {
        return message_num;
    }

    public void setMessage_num(int message_num) {
        this.message_num = message_num;
    }

    @Override
    public void show(SimType simType) {
        switch (simType) {
            case BIG_SIM:
                setCost(30);
                setTalk_time(30);
                setMessage_num(30);
                System.out.println("通话时长套餐：" + getTalk_time() + "分钟，短信套餐条数：" + getMessage_num() + "条，每月资费：" + getCost() + "元");
                break;
            case SMALL_SIM:
                setCost(20);
                setTalk_time(20);
                setMessage_num(20);
                System.out.println("通话时长套餐：" + getTalk_time() + "分钟，短信套餐条数：" + getMessage_num() + "条，每月资费：" + getCost() + "元");
                break;
            case MINI_SIM:
                setCost(10);
                setTalk_time(10);
                setMessage_num(10);
                System.out.println("通话时长套餐：" + getTalk_time() + "分钟，短信套餐条数：" + getMessage_num() + "条，每月资费：" + getCost() + "元");
                break;
            default:
                System.out.println("无此卡类型。。。");
        }

    }

    @Override
    public void call(int talk_time, SimType simType) {
        System.out.println("使用通话时长：" + talk_time + "分钟,卡类型是：" + simType.getDesc());
    }
}
